//引入文件模块
const fs = require('fs')
//读取info.json
let data = fs.readFileSync('./info.json','utf-8')
//转换格式，获取转换后的数组
let newdata = JSON.parse(data)
//随机数
let a = Math.floor(Math.random()*newdata.length)
//累加
newdata[a].count++
//转换为JSON
let b = JSON.stringify(newdata)
//存储
fs.writeFileSync('./info.json',b+'')
console.log(newdata[a])
